import axios from '@/libs/api.request'

export const updatePeriodicTask = (periodicTask) => {
  return axios.request({
    url: `api/CeleryScheduledTaskService/periodic_task/${periodicTask.id}/`,
    data: periodicTask,
    method: 'patch'
  })
};

export const deletePeriodicTask = (id) => {
  return axios.request({
    url: `api/CeleryScheduledTaskService/periodic_task/${id}/`,
    method: 'delete'
  })
};

export const getPeriodicTask = (val) => {
  return axios.request({
    url: 'api/CeleryScheduledTaskService/periodic_task/',
    params: val,
    method: 'get'
  })
};

export const createPeriodicTask = (periodicTask) => {
  return axios.request({
    url: 'api/CeleryScheduledTaskService/periodic_task/',
    data: periodicTask,
    method: 'post'
  })
};

